package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SeedPurchaseMapper;
import com.ruoyi.system.domain.SeedPurchase;
import com.ruoyi.system.service.ISeedPurchaseService;

/**
 * 种子购买信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-07-07
 */
@Service
public class SeedPurchaseServiceImpl implements ISeedPurchaseService 
{
    @Autowired
    private SeedPurchaseMapper seedPurchaseMapper;

    /**
     * 查询种子购买信息
     * 
     * @param seedPurchaseId 种子购买信息ID
     * @return 种子购买信息
     */
    @Override
    public SeedPurchase selectSeedPurchaseById(Long seedPurchaseId)
    {
        return seedPurchaseMapper.selectSeedPurchaseById(seedPurchaseId);
    }

    /**
     * 查询种子购买信息列表
     * 
     * @param seedPurchase 种子购买信息
     * @return 种子购买信息
     */
    @Override
    public List<SeedPurchase> selectSeedPurchaseList(SeedPurchase seedPurchase)
    {
        return seedPurchaseMapper.selectSeedPurchaseList(seedPurchase);
    }

    /**
     * 新增种子购买信息
     * 
     * @param seedPurchase 种子购买信息
     * @return 结果
     */
    @Override
    public int insertSeedPurchase(SeedPurchase seedPurchase)
    {
        seedPurchase.setCreateTime(DateUtils.getNowDate());
        return seedPurchaseMapper.insertSeedPurchase(seedPurchase);
    }

    /**
     * 修改种子购买信息
     * 
     * @param seedPurchase 种子购买信息
     * @return 结果
     */
    @Override
    public int updateSeedPurchase(SeedPurchase seedPurchase)
    {
        seedPurchase.setUpdateTime(DateUtils.getNowDate());
        return seedPurchaseMapper.updateSeedPurchase(seedPurchase);
    }

    /**
     * 批量删除种子购买信息
     * 
     * @param seedPurchaseIds 需要删除的种子购买信息ID
     * @return 结果
     */
    @Override
    public int deleteSeedPurchaseByIds(Long[] seedPurchaseIds)
    {
        return seedPurchaseMapper.deleteSeedPurchaseByIds(seedPurchaseIds);
    }

    /**
     * 删除种子购买信息信息
     * 
     * @param seedPurchaseId 种子购买信息ID
     * @return 结果
     */
    @Override
    public int deleteSeedPurchaseById(Long seedPurchaseId)
    {
        return seedPurchaseMapper.deleteSeedPurchaseById(seedPurchaseId);
    }
}
